<template>
	<view>
		<div class="page ">
			<view class="box">
				<view class="box_item" style="margin-top: 0;">
					<view class="box_label">主题：</view>
					<view class="box_value">{{info.title}}</view>
				</view>
				<view class="box_item">
					<view class="box_label">部门：</view>
					<view class="box_value">{{info.deptStr}}</view>
				</view>
				<view class="box_item">
					<view class="box_label">建议人：</view>
					<view class="box_value">{{info.createUserStr}}</view>
				</view>
				<view class="box_item">
					<view class="box_label">创建时间：</view>
					<view class="box_value">{{info.createDate}}</view>
				</view>
	<view class="box_item">
					<view class="box_label">内容：</view>
					<view class="box_value">{{info.content}}</view>
				</view>
	<view class="box_item">
					<view class="box_label">会议文件：</view>
					<view class="box_value" @click="nearby(info.fileUrlShow)" style="color:#267DFF ;">查看附件</view>
				</view>
			</view>
		</div>
	</view>
</template>

<script>
	import {
		adviseGetInfo,
	} from '@/api/rationalizationSuggestions.js'
	import urlConfig from "@/request/urlConfig.js";
	export default {
		data() {
			return {
				info: {}
			};
		},
		onLoad(option) {
			this.getInfo(option.id)
		},
		methods: {
			getInfo(id) {
				adviseGetInfo({
					id: id
				}).then(res => {
					console.log(res, "Res");
					this.info = res.datas
				})
			},
			nearby(url) {
				const extensionUrl = urlConfig.nearbyUrl + url
				const extension = extensionUrl.split('.').pop().toLowerCase();
				console.log(extensionUrl, "extensionUrl");
				if (extension == 'pdf') {
					window.android.startDoc(extensionUrl);
				} else {
					window.open(extensionUrl)
				}
			},
		}
	}
</script>
<style>
	page {
		background-color: #F6F6F6;
	}
</style>
<style lang="scss" scoped>
	.page {
		// padding: 60rpx;
		background-color: #FFF;
		margin-top: 50rpx;
		width: 730rpx;
		margin: 10rpx auto;
	}

	.box {
		width: 721rpx;
		background: #FFFFFF;
		margin: 0 auto;
		margin-top: 23rpx;
		border-radius: 15rpx;
		padding: 20rpx 20rpx;

		&_herder {
			padding: 30rpx 15rpx 25rpx 15rpx;
			border-bottom: 1rpx solid #F5F5F5;

			&_left {
				font-weight: 400;
				font-size: 33rpx;
				color: #1F1F1F;
				font-style: normal;
			}

			&_right {
				background: #FFDFDC;
				border-radius: 10rpx;
				border: 1rpx solid #E04734;
				padding: 14rpx 18rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 25rpx;
				color: #E04734;
			}

			&_right1 {
				background: #FFECDC;
				border-radius: 10rpx;
				border: 1rpx solid #E08A34;
				padding: 14rpx 18rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 25rpx;
				color: #E08A34;
			}
		}

		&_item {
			display: flex;
			align-items: center;
			margin-top: 30rpx;
			padding: 0 15rpx;

			&_btn {
				margin-top: 30rpx;
				border-top: 1rpx solid #F5F5F5;
				display: flex;
				// justify-content: right;
				padding-top: 33rpx;
				padding-bottom: 23rpx;
				// padding-right: 30rpx;
				justify-content: flex-end;

				&_left {
					width: 171rpx;
					height: 63rpx;
					background: #F6A234;
					border-radius: 31rpx;

					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 25rpx;
					color: #FFFFFF;
					line-height: 63rpx;
					text-align: center;
					// margin-right: 38rpx;
				}

				&_right {
					width: 171rpx;
					height: 63rpx;
					background: #267DFF;
					border-radius: 31rpx;
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 25rpx;
					color: #FFFFFF;
					line-height: 63rpx;
					text-align: center;
					font-style: normal;
					margin-left: 38rpx;
				}
			}
		}

		&_label {
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			font-size: 29rpx;
			color: #999999;
			flex: 0 0 auto;
		}

		&_value {
			font-weight: 400;
			font-size: 29rpx;
			color: #1F1F1F;
			flex: 1;
		}
	}
</style>